//-----------------------------------------------------------------------------
//
// @file	Application.h
// @brief	Application include files, variables and classes
// @author	Vinod Melapudi
// @date	01May2011
//
//-----------------------------------------------------------------------------

#ifndef _APPLICATION_H
#define _APPLICATION_H

#include <windows.h>
#include <windowsx.h>
#include <string>


// OpenGL header
#include <GL/gl.h>
#include <GL/glu.h>
#pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" )


class Renderer;
class Scene;


struct AppConfig
{
	AppConfig()
	{
		appName = "Default";
		width = 640;
		height = 480;
		scene = NULL;
	}

	HINSTANCE		hInstance;
	int				cmdShow;

	std::string		appName;
	int				width;
	int				height;

	Scene*			scene;
};


class Application
{
public:
	static Application* GetInstance();
	int Process( AppConfig& config );

	Renderer* GetRenderer();
	AppConfig GetConfig();

	void Render();
	bool HandleMessage(UINT msg, WPARAM wParam, LPARAM lParam);

private:
	Application();
	~Application();
	bool Init();
	void UnInit();

	AppConfig	m_config;
	HWND		m_wnd;
};

#endif